/**
 * HistoryGenerate.java
 *
 * Copyright (c) 2009 prjmanager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of prjmanager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table history_generate
 * @author Viorel Tacliciu
 * @version 0.0.1
 */

@Table(name="history_generate")
@Entity
public class  HistoryGenerate{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps the foreign key column FK_USER
    private Users fkUser;
    //this attribute maps the foreign key column FK_COMP_GEN
    private CustomComponents fkCompGen;
    //this attribute maps the column COMMENTS
    private  java.lang.String  comments;
    //this attribute maps the column DATE
    private  java.util.Date  date;
    //this attribute maps the column LATEST
    private  java.lang.Integer  latest;
    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
                 @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * users entity
     * @return - an Users object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "FK_USER",referencedColumnName = "ID")
    public Users getFkUser(){
        return this.fkUser;
    }

    /**
     * This method sets the field fkUser of this entity
     * @param fkUser - an Users object
     **/
    public void setFkUser(Users fkUser){
        this.fkUser=fkUser;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * component_generator entity
     * @return - an ComponentGenerator object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinColumn(name = "FK_COMP_GEN",referencedColumnName = "ID")
    public CustomComponents getFkCompGen(){
        return this.fkCompGen;
    }

    /**
     * This method sets the field fkCompGen of this entity
     * @param fkCompGen - an ComponentGenerator object
     **/
    public void setFkCompGen(CustomComponents fkCompGen){
        this.fkCompGen=fkCompGen;
    }
    /**
     * This method gets the comments attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "COMMENTS")
    public  java.lang.String  getComments(){
        return this.comments;
    }

    /**
     * The setter for COMMENTS column
     * @param comments -  an  java.lang.String  object
     **/
    public void setComments( java.lang.String  comments){
        this.comments=comments;
    }
    /**
     * This method gets the date attribute
     * @return - an  java.util.Date  object
     **/
    @Column(name = "DATE")
    public  java.util.Date  getDate(){
        return this.date;
    }

    /**
     * The setter for DATE column
     * @param date -  an  java.util.Date  object
     **/
    public void setDate( java.util.Date  date){
        this.date=date;
    }
    /**
     * This method gets the latest attribute
     * @return - an  java.lang.Integer  object
     **/
    @Column(name = "LATEST")
    public  java.lang.Integer  getLatest(){
        return this.latest;
    }

    /**
     * The setter for LATEST column
     * @param latest -  an  java.lang.Integer  object
     **/
    public void setLatest( java.lang.Integer  latest){
        this.latest=latest;
    }
}



